//
//  ZZEnterpriseBasicInfoViewModel.m
//  新项目
//
//  Created by liGordon on 17/3/14.
//  Copyright © 2017年 刘耀宗. All rights reserved.
//

#import "ZZEnterpriseBasicInfoViewModel.h"

@implementation ZZEnterpriseBasicInfoViewModel

+(instancetype)shareViewModel{
    static id instance;
    static  dispatch_once_t once;
    dispatch_once(&once, ^{
        instance=[[self alloc] init];
    });
    return instance;
    
}


-(void)getEnterpriseBasicInfoSettingWithCompanyID:(NSString *)companyID andCompanyFID:(NSString *)companyFID andIsinherit:(NSString *)isInHerit andType:(NSString *)type andCode:(NSString *)code andSuccess:(void (^)(NSDictionary *))success andFailer:(void (^)())failer
{
    NSMutableDictionary *strDic = [NSMutableDictionary dictionary];
    [strDic setKey:@"companyid" forValue:companyID];
    [strDic setKey:@"companyfid" forValue:companyFID];
    [strDic setKey:@"Isinherit" forValue:isInHerit];
    [strDic setKey:@"Type" forValue:type];
     [strDic setKey:@"Code" forValue:code];
    NSString *jsonStr=[WHJSON jsonStringWithObject:strDic];
    
    NSMutableDictionary *dic=[NSMutableDictionary dictionary];
    [dic setKey:@"data" forValue:jsonStr];
    
    [YBHttpTool post:@"api/Communal/BasicManage/GetCompanyParamSet" params:dic success:^(NSDictionary *obj) {
        DLog(@"=====%@",obj);
        if ([obj isKindOfClass:[NSNull class]] || obj==nil) {
            DLog(@"返回值为空");
            return ;
        }
        success(obj);
        
    } failure:^(NSError *error) {
        DLog(@"%@",error);
        failer();
    }];

}



@end
